﻿@model FILSTARTUPS_MOBILE.Models.FilStartUpsApi
@using FILSTARTUPS_MOBILE.Helpers

@{
    ViewBag.Title = "Index";
    
    if (User.Identity.IsAuthenticated)
    {
        Layout = "~/Views/Shared/_Layout.cshtml";
    }
    else 
    {
        Layout = "~/Views/Shared/_LayoutNonMember.cshtml";   
    }
}


@section Nav
{
    @foreach (var nav in Model.PageNav)
    {
        <li>@Html.ActionLink(nav.pagename, "Page" , new { pageidPK=nav.pageidPK, pagename=nav.pagename })</li>
    }
}

@Html.ActionLink("PostArchieves", "PostArchieves", new { catidPK = 19 })
  

<h2>HOMEPAGE</h2>
<ul data-role="listview" data-inset="true">
    <li data-role="list-divider" data-theme="a">Latest Articles</li>

 @if (Model.LatestPost == null)
 {
    <li>No Post Found</li>
 }
 else
 {  
    <li>List of the latest article</li>
   foreach (var latest in Model.LatestPost)
    {
      <li><a href="/Home/Articles?postidPK=@latest.postidPK&posttitle=@latest.posttitle"><h4>@latest.posttitle</h4> <p>@Html.Raw(Mobile_Helpers.truncate(latest.postdescription,20))</p></a></li>
     @*   <li>@Html.ActionLink(latest.posttitle, "Articles", new { postidPK = latest.postidPK, posttitle = latest.posttitle })</li>*@
    }
 }
    </ul>

<ul data-role="listview" data-inset="true">
    <li data-role="list-divider" data-theme="a">Latest News</li>
 
@if (Model.NewsPost == null)
{
    <li>No News Found</li>
}
else
{
       <li>List of the News</li>
    foreach (var news in Model.NewsPost)
    {
        <li><a href="/Home/Articles?postidPK=@news.postidPK&posttitle=@news.posttitle"> <h4>@news.posttitle</h4>  <p>@Html.Raw(Mobile_Helpers.truncate(news.postdescription, 20)) </a></li>
    }
    
    @*    <li>@Html.ActionLink(news.posttitle, "Articles", new { postidPK = news.postidPK, posttitle = news.posttitle })</li>*@
    
}
 </ul>


<ul data-role="listview" data-inset="true">
    <li data-role="list-divider" data-theme="a">Latest Event</li>
@if (Model.EventPost == null)
{
    <li>No Current Event Found</li>
}
else
{
    <li>List of the latest events</li>
    foreach (var events in Model.EventPost)
    {
           <li><a href="/Home/Articles?postidPK=@events.postidPK&posttitle=@events.posttitle"> <h4>@events.posttitle</h4> <p>@Html.Raw(Mobile_Helpers.truncate(events.postdescription, 20))</p></a></li>
@*        <li>@Html.Action(events.posttitle, "Events", "Home")</li>*@
    }
}
</ul>